<?php
Class Admin extends CI_Model
{
	var $table_name = 'admin';
	var $primary_key = 'id_username';
	
	function login($username, $password)
	{
		$this->db->select('username_admin');
		$this->db->from('admin');
		$this->db->where('username_admin', $username);
		$this->db->where('password_admin', MD5($password));
		$this->db->limit(1);

		$query = $this->db->get();

		if($query->num_rows() == 1)
			return $query->result();
		else
			return false;
	}
}
?>